import com.cwc.bean.Students;
import com.cwc.dao.StudentsDaoImpl;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Tast {
    @Test
    public void test(){
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("spring.xml");
        StudentsDaoImpl studentsDao = context.getBean("studentsDaoImpl", StudentsDaoImpl.class);
        studentsDao.insertStudents("002","李四","F16战斗机","1班","三年级");

        List<Students> students = studentsDao.selectAll();
        for (Students student : students) {
            System.out.println(student);
        }

    }
}
